package com.sss.springcloud.controller;

import com.sss.springcloud.common.Result;
import com.sss.springcloud.entities.Payment;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

/**
 * @author sss
 * @date 2020-03-06 14:13
 **/
@RestController
@RequestMapping("/payment/zk")
public class OrderZkController {

    private static  final String INVOKER_URL="http://cloud-provider-service";
    @Autowired
    private RestTemplate restTemplate;

    @GetMapping("/consumer")
    public Result<Payment> getZkPayment(){
        return restTemplate.getForObject(INVOKER_URL+"/payment/zk",Result.class);
    }
}
